/*
 * @Copyright: 2016 www.yyfax.com Inc. All rights reserved.
 */
package com.jaws.core.compatible.enums;

import java.io.Serializable;

import com.jaws.core.common.util.JacksonUtil;

/**
 * 基础枚举类
 * 
 * @author jiangmy
 * @date 2016-12-05 18:59:45
 */
@SuppressWarnings("serial")
public abstract class BaseEnum<ValueType> implements Serializable {
	protected final String name;
	protected ValueType value;
	protected String remark;

	/**
	 * 构造函数
	 * 
	 * @param name
	 * @param value
	 * @param remark
	 */
	public BaseEnum(String name, ValueType value, String remark) {
		super();
		this.name = name;
		this.value = value;
		this.remark = remark;
	}

	public String getName() {
		return name;
	}

	public ValueType getValue() {
		return value;
	}

	public String getRemark() {
		return remark;
	}

	public boolean isValue(ValueType v) {
		if(v == null){
			return false;
		}
		return value.toString().equals(v.toString());
	}

	@Override
	public String toString() {
		return JacksonUtil.toJson(this);
	}
	
}
